<template>
    <div class="land">
        <div class="padding">
			<span class="back" @click="goBack">
				<img src="../../../static/img/arrow_left@3x.png" alt="">
			</span>
            <h1 class="title">实名认证</h1>
        </div>
        <p class="text">请输入真实有效的身份证件信息：</p>
        <div class="content padding">
            <div class="name">
                <p>真实姓名</p>
                <input type="text" v-model="yourName"  placeholder="请输入真实姓名">
            </div>
            <div class="sfz">
                <p>身份证号</p>
                <input type="text" v-model="idNum"  placeholder="填写18位身份证号">
            </div>
        </div>
        <div class="send" @click="submit">提交审核</div>
    </div>
</template>
<script>
    // import axios from 'axios'
    /* eslint-disable */
    export default{
        data () {
            return {
                yourName: '',
                idNum: ''
            }
        },
        mounted () {
            this.init()
        },
        methods: {
            checkCard () {
              if (!/^\d{6}((1[89])|(2\d))\d{2}((0\d)|(1[0-2]))((3[01])|([0-2]\d))\d{3}(\d|X)$/i.test(this.idNum)) {
                this.$createToast({type: 'warn', txt: '身份证输入有误！'}).show()
              }
            },
            goBack () {
                this.$router.go(-1)
            },
            init () {
              if (localStorage.getItem('token') === null) {
                this.$router.push('/login')
              }
            },
            submit () {
              this.checkCard()
            }
        }
    }
</script>
<style lang="stylus" scoped>
    * {
        text-align: left;
        box-sizing: border-box;
    }

    .padding {
        padding: 0 1rem;
    }

    .land span.back {
        float: left;
        width: 0.6rem;
        height: 1rem;
        background-size: 0.5rem 1rem;
        margin-top: 1.5rem;

    img {
        width: 100%;
        height: 100%;
    }

    }
    .text {
        background: #f4f4f4;
        padding: 1rem 2rem 1rem 1rem;
        text-align: left;
        line-height: 1.2rem;

    }

    .title {
        font-family: PingFang-SC-Medium;
        font-size: 1.2rem;
        font-weight: normal;
        font-stretch: normal;
        line-height: 4rem;
        letter-spacing: 0rem;
        color: #333333;
        text-align: center;
    }

    .content {
        margin-top: 2rem;
    }

    .name p {
        line-height: 2rem;
    }

    .name input {
        display: block;
        width: 100%;
        border: 1px solid #ccc;
        padding: 5px;
        border-radius: 5px;
        outline: none
    }

    .sfz {
        margin-top: 1rem;
    }

    .sfz p {
        line-height: 2rem;
    }

    .sfz input {
        display: block;
        width: 100%;
        border: 1px solid #ccc;
        padding: 5px;
        border-radius: 5px;
        outline: none
    }

    .send {
        width: 90%;
        margin: 0 auto;
        background: #333;
        height: 3rem;
        color: #fff;
        text-align: center;
        line-height: 3rem;
        margin-top: 9rem;
    }
</style>